
;--------------- operand-types start --------------------
; 3 lower bits:
;	 1 == 8-bit sizes
;	 2 == 16-bit sizes
;	 3 == 32-bit sizes
;	 4 == 16- or 32-bit sizes
;	 5 == 64-bit sizes (FPU, MMX, etc)
;	 6 == 80-bit sizes (FPU)
;	 7 == unknown size
;
O_S_8		EQU	1
O_S_16		EQU	2
O_S_32		EQU	3
O_S_1632	EQU	4
O_S_64		EQU	5
O_S_80		EQU	6
O_S_UNKNOWNSIZE EQU	7

O_NONE		EQU	0
O_SEGR		EQU	008h+2
O_CR		EQU	010h+3	; CR0/CR2-3
O_DR		EQU	018h+3	; DR0-3/DR6-7
O_TR		EQU	020h+3	; TR3-7
O_Rx		EQU	028h
O_R8		EQU	028h+1
O_R16		EQU	028h+2
O_R32		EQU	028h+3
O_R1632 	EQU	028h+4

O_MMX32 	EQU	030h+3	; mmx regs
O_MMX64 	EQU	030h+5

O_LAST_REG	EQU	030h+5

O_OMx		EQU	038h
O_OM8		EQU	038h+1
O_OM16		EQU	038h+2
O_OM32		EQU	038h+3
O_OM1632	EQU	038h+4

O_OMxEXP	EQU	040h
O_OM8EXP	EQU	040h+1	; om8 expanded to 16/32. e.g 83f5ffh

O_1		EQU	048h+1	; e.g shl al,1
O_3             EQU     050h+1  ; int 3
O_CL            EQU     058h+1  ; e.g shl al,cl

O_RM8           EQU     060h+1  ; keep these together
O_RM16          EQU     060h+2  ;
O_RM32          EQU     060h+3  ;
O_RM1632        EQU     060h+4  ;
O_MMXRM64       EQU     060h+5  ;
O_Mx            EQU     068h
O_M8            EQU     068h+1  ;
O_M16           EQU     068h+2  ;
O_M32           EQU     068h+3  ;
O_M1632         EQU     068h+4  ;
O_M64           EQU     068h+5  ;
O_M80           EQU     068h+6  ;
O_M             EQU     068h+7  ;

O_ACCx          EQU     070h
O_ACC8          EQU     070h+1
O_ACC16         EQU     070h+2
O_ACC32         EQU     070h+3
O_ACC1632       EQU     070h+4

O_OFFSx         EQU     078h
O_OFFS16        EQU     078h+2
O_OFFS32        EQU     078h+3
O_OFFS1632      EQU     078h+4
O_OFFS          EQU     078h+7
O_DX            EQU     080h+2
O_RELx          EQU     088h
O_REL8          EQU     088h+1
O_REL16         EQU     088h+2
O_REL32         EQU     088h+3
O_REL1632       EQU     088h+4

O_FARx          EQU     090h    ; f.[bx]
O_FAR16         EQU     090h+2
O_FAR32         EQU     090h+3
O_FAR1632       EQU     090h+4

O_DFARx         EQU     098h    ; 0000:00000000
O_DFAR16        EQU     098h+2
O_DFAR32        EQU     098h+3
O_DFAR1632      EQU     098h+4

O_FPUR          EQU     0a0h+6  ; st0-st7
O_ST            EQU     0a8h+6  ; st0

O_ERROR 	EQU	0ffh

;-------------- operand-types end ----------------------

;-------------- operand-bytes start --------------------

OB_NONE 	EQU	0	; no address-byte
OB_SR		EQU	1	; '/r'

OB_R0		EQU	2	; +r ( r == 0 )
OB_R1		EQU	3	; +r ( r == 1 )
OB_R2		EQU	4	; +r ( r == 2 )
OB_R3		EQU	5	; +r ( r == 3 )
OB_R4		EQU	6	; +r ( r == 4 )
OB_R5		EQU	7	; +r ( r == 5 )
OB_R6		EQU	8	; +r ( r == 6 )
OB_R7		EQU	9	; +r ( r == 7 )

OB_0		EQU	10	; '/0' (+r is coded this way as well)
OB_1		EQU	11	; '/1' ----------- " " --------------
OB_2		EQU	12	; '/2' ----------- " " --------------
OB_3		EQU	13	; '/3' ----------- " " --------------
OB_4		EQU	14	; '/4' ----------- " " --------------
OB_5		EQU	15	; '/5' ----------- " " --------------
OB_6		EQU	16	; '/6' ----------- " " --------------
OB_7		EQU	17	; '/7' ----------- " " --------------

OB_ESC		EQU	18	; Used for decoding ESC instructions
OB_DATASIZE	EQU	19	; 66h-prefix
OB_ADDRESSIZE	EQU	20	; 67h-prefix

;-------------- operand-bytes end ----------------------

;-------------- mnemonics start ------------------------

M_MOV	EQU	0
M_XCHG	EQU	1
M_PUSH	EQU	2
M_POP	EQU	3
M_PUSHA EQU	4
M_POPA	EQU	5
M_PUSHF EQU	6
M_POPF	EQU	7
M_LEA	EQU	8
M_LDS	EQU	9
M_LES	EQU	10
M_LFS	EQU	11
M_LGS	EQU	12
M_LSS	EQU	13
M_IN	EQU	14
M_OUT	EQU	15
M_MOVSB EQU	16
M_MOVSW EQU	17
M_INSB	EQU	18
M_INSW	EQU	19
M_OUTSB EQU	20
M_OUTSW EQU	21
M_CMPSB EQU	22
M_CMPSW EQU	23
M_SCASB EQU	24
M_SCASW EQU	25
M_LODSB EQU	26
M_LODSW EQU	27
M_STOSB EQU	28
M_STOSW EQU	29
M_REPE	EQU	30
M_REPNE EQU	31
M_XLATB EQU	32
M_INC	EQU	33
M_DEC	EQU	34
M_MUL	EQU	35
M_IMUL	EQU	36
M_DIV	EQU	37
M_IDIV	EQU	38
M_NEG	EQU	39
M_ADC	EQU	40
M_ADD	EQU	41
M_AND	EQU	42
M_CMP	EQU	43
M_OR	EQU	44
M_SBB	EQU	45
M_SUB	EQU	46
M_XOR	EQU	47
M_AAA	EQU	48
M_DAA	EQU	49
M_DAS	EQU	50
M_AAS	EQU	51
M_AAD	EQU	52
M_AAM	EQU	53
M_JMP	EQU	54
M_CALL	EQU	55
M_RET	EQU	56
M_RETF	EQU	57
M_TEST	EQU	58
M_JA	EQU	59
M_JAE	EQU	60
M_JB	EQU	61
M_JBE	EQU	62
M_JZ	EQU	63
M_JG	EQU	64
M_JGE	EQU	65
M_JL	EQU	66
M_JLE	EQU	67
M_JNZ	EQU	68
M_JNO	EQU	69
M_JNP	EQU	70
M_JNS	EQU	71
M_JO	EQU	72
M_JP	EQU	73
M_JS	EQU	74
M_JCXZ	EQU	75
M_LOOP	EQU	76
M_LOOPE EQU	77
M_LOOPNE EQU	78
M_INT3	EQU	79
M_INT	EQU	80
M_INTO	EQU	81
M_IRET	EQU	82
M_CLI	EQU	83
M_STI	EQU	84
M_NOT	EQU	85
M_SAR	EQU	86
M_SHL	EQU	87
M_SHR	EQU	88
M_RCL	EQU	89
M_RCR	EQU	90
M_ROL	EQU	91
M_ROR	EQU	92
M_BT	EQU	93
M_BTC	EQU	94
M_BTR	EQU	95
M_BTS	EQU	96
M_BSF	EQU	97
M_BSR	EQU	98
M_CLC	EQU	99
M_STC	EQU	100
M_CMC	EQU	101
M_CLD	EQU	102
M_STD	EQU	103
M_LAHF	EQU	104
M_SAHF	EQU	105
M_WAIT	EQU	106
M_HLT	EQU	107
M_LOCK	EQU	108
M_NOP	EQU	109
M_ESC	EQU	110
M_CLTS	EQU	111
M_SGDT	EQU	112
M_SIDT	EQU	113
M_STR	EQU	114
M_LTR	EQU	115
M_SLDT	EQU	116
M_LLDT	EQU	117
M_ARPL	EQU	118
M_LAR	EQU	119
M_LSL	EQU	120
M_VERR	EQU	121
M_VERW	EQU	122
M_LMSW	EQU	123
M_SMSW	EQU	124
M_MOVZX EQU	125
M_MOVSX EQU	126
M_CBW	EQU	127
M_CWD	EQU	128
M_BOUND EQU	129
M_ENTER EQU	130
M_LEAVE EQU	131
M_SETA	EQU	132
M_SETAE EQU	133
M_SETB	EQU	134
M_SETBE EQU	135
M_SETZ	EQU	136
M_SETG	EQU	137
M_SETGE EQU	138
M_SETL	EQU	139
M_SETLE EQU	140
M_SETNZ EQU	141
M_SETNO EQU	142
M_SETNP EQU	143
M_SETNS EQU	144
M_SETO	EQU	145
M_SETP	EQU	146
M_SETS	EQU	147
M_CMPXCHG EQU	148
M_XADD	EQU	149
M_BSWAP EQU	150
M_INVD	EQU	151
M_WBINVD EQU	152
M_INVLPG EQU	153

M_OVERRIDE_LOW	EQU	154
M_ESOVERRIDE	EQU	154
M_CSOVERRIDE	EQU	155
M_SSOVERRIDE	EQU	156
M_DSOVERRIDE	EQU	157
M_FSOVERRIDE	EQU	158
M_GSOVERRIDE	EQU	159
M_OVERRIDE_HIGH EQU	159

M_PUSHAD EQU	160
M_POPAD EQU	161
M_PUSHFD EQU	162
M_POPFD EQU	163
M_MOVSD EQU	164
M_INSD	EQU	165
M_OUTSD EQU	166
M_CMPSD EQU	167
M_SCASD EQU	168
M_LODSD EQU	169
M_STOSD EQU	170
M_IRETD EQU	171
M_CWDE	EQU	172
M_CDQ	EQU	173
M_SALC	EQU    174
M_LOADALL286 EQU 175
M_LOADALL386 EQU 176
M_CMPXCHG8B EQU 177
M_CPUID EQU	178
M_RDTSC EQU	179
M_RDMSR EQU	180
M_WRMSR EQU	181
M_RSM	EQU	182
M_RDPMC EQU	183

M_FSETPM	EQU	184
M_FLD		EQU	185
M_FST		EQU	186
M_FSTP		EQU	187
M_FILD		EQU	188
M_FIST		EQU	189
M_FISTP 	EQU	190
M_FBLD		EQU	191
M_FBSTP 	EQU	192
M_FXCH		EQU	193
M_FLD1		EQU	194
M_FLDL2T	EQU	195
M_FLDL2E	EQU	196
M_FLDPI 	EQU	197
M_FLDLG2	EQU	198
M_FLDLN2	EQU	199
M_FLDZ		EQU	200
M_FCOM		EQU	201
M_FCOMP 	EQU	202
M_FCOMPP	EQU	203
M_FUCOM 	EQU	204
M_FUCOMP	EQU	205
M_FUCOMPP	EQU	206
M_FICOM 	EQU	207
M_FICOMP	EQU	208
M_FTST		EQU	209
M_FXAM		EQU	210
M_FSTSW 	EQU	211
M_FNSTSW	EQU	212
M_FADD		EQU	213
M_FADDP 	EQU	214
M_FIADD 	EQU	215
M_FSUB		EQU	216
M_FSUBP 	EQU	217
M_FISUB 	EQU	218
M_FSUBR 	EQU	219
M_FSUBRP	EQU	220
M_FISUBR	EQU	221
M_FMUL		EQU	222
M_FMULP 	EQU	223
M_FIMUL 	EQU	224
M_FDIV		EQU	225
M_FDIVP 	EQU	226
M_FIDIV 	EQU	227
M_FDIVR 	EQU	228
M_FDIVRP	EQU	229
M_FIDIVR	EQU	230
M_FPTAN 	EQU	231
M_FSINCOS	EQU	232
M_FSIN		EQU	233
M_FCOS		EQU	234
M_FPATAN	EQU	235
M_F2XM1 	EQU	236
M_FYL2X 	EQU	237
M_FYL2XP1	EQU	238
M_FINIT 	EQU	239
M_FNINIT	EQU	240
M_FSTCW 	EQU	241
M_FNSTCW	EQU	242
M_FLDCW 	EQU	243
M_FINCSTP	EQU	244
M_FDECSTP	EQU	245
M_FNOP		EQU	246
M_FCLEX 	EQU	247
M_FNCLEX	EQU	248
M_FSTENV	EQU	249
M_FNSTENV	EQU	250
M_FLDENV	EQU	251
M_FSAVE 	EQU	252
M_FNSAVE	EQU	253
M_FRSTOR	EQU	254
M_FSQRT 	EQU	255
M_FSCALE	EQU	256
M_FABS		EQU	257
M_FCHS		EQU	258
M_FPREM 	EQU	259
M_FPREM1	EQU	260
M_FRNDINT	EQU	261
M_FXTRACT	EQU	262

M_ICEBP 	EQU	263
M_UD2		EQU	264

M_CMOVO 	EQU	265
M_CMOVNO	EQU	266
M_CMOVB 	EQU	267
M_CMOVAE	EQU	268
M_CMOVZ 	EQU	269
M_CMOVNZ	EQU	270
M_CMOVBE	EQU	271
M_CMOVA 	EQU	272
M_CMOVS 	EQU	273
M_CMOVNS	EQU	274
M_CMOVP 	EQU	275
M_CMOVNP	EQU	276
M_CMOVL 	EQU	277
M_CMOVGE	EQU	278
M_CMOVLE	EQU	279
M_CMOVG 	EQU	280
M_FCMOVB	EQU	281
M_FCMOVZ	EQU	282
M_FCMOVBE	EQU	283
M_FCMOVU	EQU	284
M_FCMOVAE	EQU	285
M_FCMOVNZ	EQU	286
M_FCMOVA	EQU	287
M_FCMOVNU	EQU	288
M_FCOMI 	EQU	289
M_FCOMIP	EQU	290
M_FUCOMI	EQU	291
M_FUCOMIP	EQU	292

M_SHLD		EQU	293
M_SHRD		EQU	294

M_FOOF		EQU	295

M_LGDT		EQU	296
M_LIDT		EQU	297

M_FXSAVE	EQU	298
M_FXRSTOR	EQU	299

M_MOVD		EQU	300
M_MOVQ		EQU	301
M_PADDB 	EQU	302
M_PADDW 	EQU	303
M_PADDD 	EQU	304
M_PADDSB	EQU	305
M_PADDSW	EQU	306
M_PADDUSB	EQU	307
M_PADDUSW	EQU	308
M_PSUBB 	EQU	309
M_PSUBW 	EQU	310
M_PSUBD 	EQU	311
M_PSUBSB	EQU	312
M_PSUBSW	EQU	313
M_PSUBUSB	EQU	314
M_PSUBUSW	EQU	315
M_PMULHW	EQU	316
M_PMULLW	EQU	317
M_PMADDWD	EQU	318
M_PCMPEQB	EQU	319
M_PCMPEQW	EQU	320
M_PCMPEQD	EQU	321
M_PCMPGTB	EQU	322
M_PCMPGTW	EQU	323
M_PCMPGTD	EQU	324
M_PACKUSWB	EQU	325
M_PACKSSWB	EQU	326
M_PACKSSDW	EQU	327
M_PUNPCKHBW	EQU	328
M_PUNPCKHWD	EQU	329
M_PUNPCKHDQ	EQU	330
M_PUNPCKLBW	EQU	331
M_PUNPCKLWD	EQU	332
M_PUNPCKLDQ	EQU	333
M_PAND		EQU	334
M_PANDN 	EQU	335
M_POR		EQU	336
M_PXOR		EQU	337
M_PSLLW 	EQU	338
M_PSLLD 	EQU	339
M_PSLLQ 	EQU	340
M_PSRLW 	EQU	341
M_PSRLD 	EQU	342
M_PSRLQ 	EQU	343
M_PSRAW 	EQU	344
M_PSRAD 	EQU	345
M_EMMS		EQU	346


M_3DNOW 	EQU	347	; generic 3DNow! mnemonic
M_3DNOWFIRST    EQU     347

M_PAVGUSB	EQU	347
M_PFADD 	EQU	348
M_PFSUB 	EQU	349
M_PFSUBR	EQU	350
M_PFACC 	EQU	351
M_PFCMPGE	EQU	352
M_PFCMPGT	EQU	353
M_PFCMPEQ	EQU	354
M_PFMIN 	EQU	355
M_PFMAX 	EQU	356
M_PI2FD 	EQU	357
M_PF2ID 	EQU	358
M_PFRCP 	EQU	359
M_PFRSQRT	EQU	360
M_PFMUL 	EQU	361
M_PFRCPIT1	EQU	362
M_PFRSQIT1	EQU	363
M_PFRCPIT2	EQU	364
M_PMULHRW	EQU	365

M_3DNOWLAST	EQU	365

M_FEMMS 	EQU	366
M_PREFETCH	EQU	367


M_SYSENTER	EQU	368
M_SYSEXIT	EQU	369

M_JECXZ 	EQU	370

M_UMOV		EQU	371

M_FENI		EQU	372
M_FNENI 	EQU	373
M_FFREE 	EQU	374

M_JC		EQU	375
M_JNC		EQU	376
M_JE		EQU	377
M_JNE		EQU	378
M_JNB		EQU	379
M_JNA		EQU	380
M_JNL		EQU	381
M_JNG		EQU	382

M_SETC		EQU	383
M_SETNC 	EQU	384
M_SETE		EQU	385
M_SETNE 	EQU	386
M_SETNB 	EQU	387
M_SETNA 	EQU	388
M_SETNL 	EQU	389
M_SETNG 	EQU	390

M_CMOVC 	EQU	391
M_CMOVNC	EQU	392
M_CMOVNB	EQU	393
M_CMOVE 	EQU	394
M_CMOVNE	EQU	395
M_CMOVNA	EQU	396
M_CMOVNL	EQU	397
M_CMOVNG	EQU	398

M_FCMOVC	EQU	399
M_FCMOVNC	EQU	400
M_FCMOVNB	EQU	401
M_FCMOVE	EQU	402
M_FCMOVNE	EQU	403
M_FCMOVNA	EQU	404

M_REP           EQU     405

M_PREFETCHW	EQU	406

;--------------- mnemonics end --------------------------





